$(document).ready(function() {
$.getJSON('http://pypi.qpython.org/index/list_libraries.php', function(data) {
    $.each(data, function(k,cat){
        $('<tr><td colspan="3" style="background:black;padding:5px;color:white"><strong>'+cat['title']+'</strong></td></tr>').appendTo($('#featured-videos'))
        $.each(cat['list'], function(k1,item) {
            $('<tr id="item-'+k+'-'+k1+'" onclick="milib.qpylibinstall(\''+item['cat']+'\',\''+item['link']+'\',\''+item['target']+'\')"><td>&nbsp;'+item['title']+'</td><td>Module name:<b>'+item['target']+'</b><br />Sample: <span style="color:grey">import '+item['target']+'</span><br /><br />Description:'+item['desc']+'</td><td width="40"><img width="40" height="40" src="http://pypi.qpython.org/index/images/ic_download.png" /></td></tr>').appendTo($('#featured-videos'))
        });
    });
});
});
